package org.example.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.example.sys.entity.TSysRole;
import org.example.sys.entity.TSysUserRole;

import java.util.List;

/**
 * 用户角色表(TSysUserRole)表数据库访问层
 * @author Calvin
 */
public interface TSysUserRoleMapper extends BaseMapper<TSysUserRole> {

    List<TSysRole> listByUserId(Long userId);

    /**
     * 批量添加用户角色
     * @param userId  用户id
     * @param roleIds 角色id集合
     * @return int
     */
    int saveBatch(@Param("userId") Long userId, @Param("roleIds") List<Long> roleIds);

}

